Method: rich.markup.escape.<locals>.escape_backslashes
Calls: 10, Exceptions: 0, Paths: 1Back
Path 1: 10 calls (1.0)
Match (10)
'\\[bar]' (1) '\\\\\\[bar]' (1) '\\[@foo]' (1) '\\[@]' (1) '\\[nil]' (1) '\\[red]' (1) '\\\\\\[red]' (1) '\\\\\\\\\\[red]' (1) '\\\\\\\\\\\\\\[red]' (...
1def escape_backslashes(match: Match[str]) -> str:
2 """Called by re.sub replace matches."""
3 backslashes, text = match.groups()
4 return f"{backslashes}{backslashes}\\{text}"